package com.v5ba.action;

import com.v5ba.sms.entity.User;
import com.v5ba.sms.service.OrgService;
import com.v5ba.sms.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoControler {

    @DubboReference(version = "1.0.0")
    private UserService userService;

    @DubboReference(version = "1.0.0")
    private OrgService orgService;

    @GetMapping("user/get")
    public String getUser(){
        return userService.getUser().getName();
    }
    @GetMapping("user/getName")
    public String getUserName(){
        User user = userService.getUsers().getData().get(0);
        return user.getName();
    }
    @GetMapping("org/get")
    public String getOrg(){
        return orgService.getOrg().getName();
    }
}
